package com.swpu.Pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 功能描述：
 *
 * @Author: ygq
 * @Date: 2021/2/19 17:47
 */

public class Books {
    private int bookID;
    private String bookName;
    private int bookCounts;
    private String detail;
    private Date bdate;
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    public Books() {
    }

    public Books(int bookID, String bookName, int bookCounts, String detail,Date bdate) {
        this.bookID = bookID;
        this.bookName = bookName;
        this.bookCounts = bookCounts;
        this.detail = detail;
        this.bdate = bdate;
    }

    public Date getBdate() {
        return dateFormat.parse(bdate);
    }

    public void setBdate(Date bdate) {
        this.bdate = bdate;
    }

    public int getBookID() {
        return bookID;
    }

    public void setBookID(int bookID) {
        this.bookID = bookID;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public int getBookCounts() {
        return bookCounts;
    }

    public void setBookCounts(int bookCounts) {
        this.bookCounts = bookCounts;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        return "Books{" +
                "bookID=" + bookID +
                ", bookName='" + bookName + '\'' +
                ", bookCounts=" + bookCounts +
                ", detail='" + detail + '\'' +
                '}';
    }
}
